Make your own free website on Tripod.com



/*  

foreach was added in DMD 0.71
http://www.digitalmars.com/d/statement.html#foreach


"inout" can be used to update the original elements.

*/



void test()
    {
        static uint[2] a = [7, 8];

        foreach (inout uint u; a)
        {
        u++;
        }
        foreach (uint u; a)
        {
        printf("%d\n", u);
        }
    }



int main()
{

    test();
    return 0;

}